/**
 * Copyright By Grandsoft Company Limited.  
 * 2013-6-13 上午11:30:05
 */
package com.glodon.ggzy.jypt.controller;

import java.io.IOException;

import javax.servlet.http.HttpServletResponse;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import com.glodon.ggzy.core.utils.PageSearchModel;
import com.glodon.ggzy.entity.GgCqTbgg;
import com.glodon.ggzy.entity.GgCqZbcjgg;
import com.glodon.ggzy.fwpt.service.ICqjyProjectService;
import com.glodon.ggzy.fwpt.service.IJsgcProjectService;

/**
 * 受让人控制类
 * @author zhangxj
 * @date 2013-6-12
 *
 */
@Controller
public class SrrController {

	protected Logger logger = LoggerFactory.getLogger(getClass());

	@Autowired
	private ICqjyProjectService cqjyProjectService;
	/**
	 * 
	 * 出让人-主页
	 * @param model
	 * @return
	 */
	@RequestMapping("/jypt/srr_index")
	public String srrIndex(Model model) {
		return "/jypt/srr_index";
	}

	
	@RequestMapping("/jypt/srr_zbgg")
	public String zrrZbgg(Model model){
		return "/jypt/srr_zbgg";
	}
	
	@RequestMapping("/jypt/srr_zbgs")
	public String zrrZbgs(Model model){
		return "/jypt/srr_zbgs";
	}
	
	@RequestMapping("/jypt/srr_tbgs")
	public String zrrYzbgs(Model model){
		return "/jypt/srr_tbgs";
	}

	/**
	* 获取信息公开-产权交易详情
	* type:特别公告、中标公示
	* @param model
	* @return
	*/
	@RequestMapping("/jypt/srr_cqjy_detail")
	public String getXxgkCqjyDetail(String id, String prjType, Model model) {
		if ("zbgs".equals(prjType)) {
			GgCqZbcjgg zbgs = cqjyProjectService.getZbgsById(id);
			model.addAttribute("name", zbgs.getName());
			model.addAttribute("text", zbgs.getText());
			model.addAttribute("navigation", "中标公示");
		}
		if ("tbgs".equals(prjType)) {
			GgCqTbgg tbgs = cqjyProjectService.getTbggById(id);
			model.addAttribute("name", tbgs.getName());
			model.addAttribute("text", tbgs.getText());
			model.addAttribute("navigation", "特别公告");
		}
		return "/jypt/srr_cqjy_detail";
	}

}
